function class(className)
	if(type(className) ~= "string")then
		error("Expected string at argument 1, got "..type(className), 2)
	end
	if(_G[className])then
		error("class '"..className.."' has already been registered", 2)
	end
	_G[className] = {}
	_G[className].__index = _G[className]
	setmetatable(_G[className],
	{
		__call = 
			function(this, ...)
				local instance = {}
				setmetatable(instance, this)
				if(not instance.constructor)then
					error("No constructor exists for class '"..className.."'", 2)
				end
				local result = {instance:constructor(...)}
				return instance, unpack(result)
			end
	})
end